#include <vector>
#include <string>

#include "mp2_types.h"

using namespace std;
using namespace mp2;

typedef struct _File {
    string name;
    string data;
} File;

string get_keys_table_as_string(const std::map<int32_t,File>& table);
string get_finger_table_as_string(const std::vector<Node>& table, const uint32_t m, const uint32_t myid, const uint32_t idx_of_entry1);

string get_GET_TABLE_result_as_string(const vector<Node>& finger_table, const uint32_t m, const uint32_t myid, const uint32_t idx_of_entry1, const std::map<int32_t, File>& keys_table);
string get_ADD_FILE_result_as_string(const char *fname, const int32_t key, const int32_t nodeId);
string get_DEL_FILE_result_as_string(const char *fname, const int32_t key, const bool deleted, const int32_t nodeId);
string get_GET_FILE_result_as_string(const char *fname, const int32_t key, const bool found, const int32_t nodeId, const char *fdata);

int hashValue(const char* value, int m);
